<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<div class="right-s-box u-my-course_box pb10">
    <table class="table uTable">
        <thead>
        <tr>
            <th width="40%"><span class="c-333 fs12">商品名称</span></th>
            <th width="10%" class="text-center"><span class="c-333 fs12">应付/实付</span></th>
            <th width="10%" class="text-center"><span class="c-333 fs12">类型</span></th>
            <th width="12%" class="text-center"><span class="c-333 fs12">总计</span></th>
            <th width="10%" class="text-center"><span class="c-333 fs12">状态</span></th>
            <th width="18%" class="text-center"><span class="c-333 fs12">操作</span></th>
        </tr>
        </thead>
    </table>
    <div class="mt10">
        <!--无数据提示 开始-->
        <section th:if="${#lists.isEmpty(dataMap['list'])}" class="no-data__wrap">
            <span class="no-data-ico"></span>
            <p class="mt20"><span class="c-666">你最近没有购买任何商品，建议先去选课~~~</span></p>
            <p class="mt20 pt10">
                <a th:href="@{/web/course/courseList}">
                    <button class="btn btn-lg btn-warning btn-rounded" type="button" style="width: 180px"> 去 选 课 </button>
                </a>
            </p>
        </section>
        <!--无数据提示 结束-->
        <section th:if="!${#lists.isEmpty(dataMap['list'])}" class="u-order-list-item">
            <table th:each="order : ${dataMap['list']}" class="table" th:attrappend="id='user-order-list-box-'+${order['id']}">
                <tbody>
                <tr>
                    <td colspan="6" class="u-order-item-title">
                        <section class="bg-f2 pt10 pb10 pl10 pr10 ">
                            <div class="hLh30">
                                <aside class="pull-right">
                                    <a href="javascript:void(0);" th:attrappend="data-id=${order['id']}" class="c-999 delete-order-box" title="删除">
                                        <i class="fa fa-trash-o"></i>
                                    </a>
                                </aside>
                                <aside class="pull-left">
                                    <span class="c-333" th:text="'订单号：'+${order['orderNo']}"></span>
                                    <span class="c-666 ml20" th:text="'下单时间：'+${#strings.substring(order['createTime'],0,16)}">
                                    </span>
                                </aside>
                            </div>
                        </section>
                    </td>
                </tr>
                <tr th:if="!${#lists.isEmpty(order['orderDetailsList'])}" th:each="details,index : ${order['orderDetailsList']}">
                    <td width="40%">
                        <div class="media">
                            <div th:if="${details['shopType']}=='COURSE'" class="media-left">
                                <a th:href="${details['courseType']} eq 'LIVE' ?@{/web/course/liveInfo?courseId={courseId}(courseId=${details['shopId']})}:@{/web/course/courseInfo?courseId={courseId}(courseId=${details['shopId']})}" target="_blank">
                                    <img class="media-object lazy" th:attr="data-original=${details['shop']['course']['imageMap']}!=null?${details['shop']['course']['imageMap']['pcUrlMap']['medium']}:''" style="display: block;" width="80"/>
                                </a>
                            </div>
                            <div th:if="${details['shopType']}=='BOOK'" class="media-left">
                                <a th:href="@{/web/book/info?bookId={bookId}(bookId=${details['shopId']})}" target="_blank">
                                    <img class="media-object lazy" th:attr="data-original=${details['shop']['book']['imageMap']['pcUrlMap']['small']}" style="display: block;" width="80"/>
                                </a>
                            </div>
                            <div class="media-body">
                                <section class="cm-desc-txt__twoLine">
                                    <a th:if="${details['shopType']}=='COURSE'" th:href="${details['courseType']} eq 'LIVE' ?@{/web/course/liveInfo?courseId={courseId}(courseId=${details['shopId']})}:@{/web/course/courseInfo?courseId={courseId}(courseId=${details['shopId']})}" target="_blank" class="c-999" th:text="${details['shop']['course']['courseName']}"></a>
                                    <a th:if="${details['shopType']}=='BOOK'" th:href="@{/web/book/info?bookId={bookId}(bookId=${details['shopId']})}" target="_blank" class="c-999" th:text="${details['shop']['book']['bookName']}"></a>
                                    <a th:if="${details['shopType']}=='MEMBER'" href="javascript:void(0);" class="c-999" th:text="${#maps.isEmpty(details['shop']['member'])}?'会员商品不存在':${details['shop']['member']['memberName']}"></a>
                                    <a th:if="${details['shopType']}=='ACCOUNT'" href="javascript:void(0);" class="c-999">账户充值</a>
                                    <a th:if="${details['shopType']}=='EXAM'" href="javascript:void(0);" id="exam-page" class="c-999" th:attrappend="data-id=${details['shopId']},data-status=${order['orderStatus']}" th:text="!${#maps.isEmpty(details['shop'])} and !${#maps.isEmpty(details['shop']['exam'])}?${details['shop']['exam']['name']}:'试卷不存在'"></a>
                                    <a th:href="${details['shop']['qa']['status']}==3? 'javascript:void(0);':@{/web/qa/questionInfo?questionId={questionId}(questionId=${details['shopId']})}" th:if="${details['shopType']}=='QA'" href="javascript:void(0);" class="c-999" th:text="${details['shop']['qa']['status']}==3?'该问答内容已被删除':(!${#maps.isEmpty(details['shop'])} and !${#maps.isEmpty(details['shop']['qa'])} and !${#strings.isEmpty(details['shop']['qa']['context'])} ? ${details['shop']['qa']['context']}:'问答内容不存在')"></a>
                                    <a th:href="@{/web/qa/questionInfo?questionId={questionId}(questionId=${details['shopId']})}" th:if="${details['shopType']}=='ATTEND'" href="javascript:void(0);" class="c-999" th:text="!${#maps.isEmpty(details['shop'])} and !${#maps.isEmpty(details['shop']['qa'])} and !${#strings.isEmpty(details['shop']['qa']['context'])} ? ${details['shop']['qa']['context']}:'旁听问答内容不存在'"></a>
                                </section>
                            </div>
                        </div>
                    </td>
                    <td width="12%" class="text-center" style="vertical-align: middle;" valign="middle">
                        <span class="c-666"><small class="fs12"><i class="fa fa-yen"></i></small>
                        <samp th:text="${order['sumPrice']} + '/' +${details['realPrice']}"></samp>
                        </span>
                    </td>
                    <td width="10%" class="text-center" style="vertical-align: middle;" valign="middle">
                        <span class="c-666" th:if="${details['shopType']}=='COURSE'">课程</span>
                        <span class="c-666" th:if="${details['shopType']}=='BOOK'">图书</span>
                        <span class="c-666" th:if="${details['shopType']}=='MEMBER'">会员</span>
                        <span class="c-666" th:if="${details['shopType']}=='ACCOUNT'">充值</span>
                        <span class="c-666" th:if="${details['shopType']}=='EXAM'">试卷</span>
                        <span class="c-666" th:if="${details['shopType']}=='QA'">问答</span>
                        <span class="c-666" th:if="${details['shopType']}=='ATTEND'">旁听</span>
                    </td>
                    <td width="10%" class="text-center" style="vertical-align: middle;" valign="middle">
                        <span class="c-666" th:text="${details['buyNum']}"></span>
                    </td>
                    <td th:if="${index['index']}==0" th:rowspan="${#lists.size(order['orderDetailsList'])}" th:attrappend="id='order-status-text-'+${order['id']}" width="12%" class="text-center" style="vertical-align: middle;" valign="middle">
                        <span th:if="${order['orderStatus']}=='INIT'" class="c-danger">未支付</span>
                        <span th:if="${order['orderStatus']}=='SUCCESS'" class="c-success">已支付</span>
                        <span th:if="${order['orderStatus']}=='REFUND'" class="c-info">已退费</span>
                        <span th:if="${order['orderStatus']}=='CANCEL'" class="c-666">已取消</span>
                    </td>
                    <td  th:if="${index['index']}==0" th:rowspan="${#lists.size(order['orderDetailsList'])}" width="16%" class="text-center" style="vertical-align: middle;" valign="middle">
                        <a th:if="${order['orderStatus']}=='INIT'" th:href="@{/web/uc/order/newlyOrder?orderId={orderId}(orderId=${order['id']})}" th:attrappend="id='order-pay-btn-'+${order['id']}" th:classappend="'pay-order-'+${order['id']}" target="_blank">
                            <button type="button" class="btn btn-danger mb5 btn-rounded">立即付款</button>
                        </a>
                        <br th:if="${order['orderStatus']}=='INIT'"/>
                        <a th:if="${order['orderStatus']}=='INIT'" href="javascript:void(0);" class="fs12 c-999 cancel-order" th:attrappend="data-id=${order['id']}">取消订单</a>
                        <a th:href="@{/web/uc/order/orderInfo?orderId={orderId}(orderId=${order['id']})}" class="c-999 fs12">订单详情</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </section>
    </div>
</div>
<div data-th-replace="layout/user/user-center-page"></div>
</html>

